/**
 * 
 */
package com.wsj.service.impl;

import org.springframework.dao.DataAccessException;

import com.wsj.dao.IUserBaseDao;
import com.wsj.dao.IUserInfoDao;
import com.wsj.service.IUserManagerServ;
import com.wsj.util.exception.BusinessException;
import com.wsj.web.vo.homeSite.UserBase;

/**
 * @author fengbin  createTime:2009-7-5
 * 用户管理服务bean
 */
public class UserManagerServImpl implements IUserManagerServ{
	
	private IUserBaseDao userBaseDao;
	
	private IUserInfoDao userInfoDao;

	public IUserBaseDao getUserBaseDao() {
		return userBaseDao;
	}

	public void setUserBaseDao(IUserBaseDao userBaseDao) {
		this.userBaseDao = userBaseDao;
	}

	public IUserInfoDao getUserInfoDao() {
		return userInfoDao;
	}

	public void setUserInfoDao(IUserInfoDao userInfoDao) {
		this.userInfoDao = userInfoDao;
	}
	
	
	
	/**********
	 * 通过用户id,获取用户的基本信息
	 */
	public UserBase getUserBaseById(long userId) throws BusinessException{
		try {
			return this.userBaseDao.getUserBaseById(userId);
		} catch (DataAccessException e) {
			
			throw new BusinessException("getUserBaseById error",e);
		}
	}
	
	
	/**********
	 * 通过用户id,获取用户的基本信息
	 */
	public UserBase getUserBaseByUserName(String userName) throws BusinessException{
		try {
			return this.userBaseDao.getUserBaseByUserName(userName);
		} catch (DataAccessException e) {
			
			throw new BusinessException("getUserBaseByUserName error",e);
		}
	}
	
	

}
